﻿using ChessGame.Pieces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChessGame.Pieces
{
    /// <summary>
    /// King's object
    /// </summary>
    public class King : Chesspiece
    {
        /// <summary>
        /// King Constructor
        /// </summary>
        /// <param name="_colour">Side colour of the King</param>
        /// <param name="_positionX">Position X</param>
        /// <param name="_positionY">Position Y</param>
        public King(Boolean _colour, int _positionX, int _positionY)
        {
            Colour = _colour;
            PositionX = _positionX;
            PositionY = _positionY;
            Type = "King";
            PieceValue = 100;
            movement = new Movement.Movement();
            startMovement = new Movement.Movement();
            hit = new Movement.Hit();
            movement.Add(1, 0);
            movement.Add(1, 1);
            movement.Add(1, -1);
            movement.Add(0, 1);
            movement.Add(0, -1);
            movement.Add(-1, 0);
            movement.Add(-1, 1);
            movement.Add(-1, -1);

            hit.Add(1, 0);
            hit.Add(1, 1);
            hit.Add(1, -1);
            hit.Add(0, 1);
            hit.Add(0, -1);
            hit.Add(-1, 0);
            hit.Add(-1, 1);
            hit.Add(-1, -1);

            if (_colour)
            {
                startMovement.Add(0, 2);
                startMovement.Add(0, 1);
            }
            else
            {
                startMovement.Add(0, -2);
                startMovement.Add(0, -1);
            }
            firstMove = false;
        }

    }
}
